#ifndef REPRESENTATION_DIALOG_H
#define REPRESENTATION_DIALOG_H

#include <QDialog>
#include <QLabel>
#include <QListWidget>
#include <QListWidgetItem>
#include <QStackedWidget>
#include <QImage>

#include "../src/representation.h"
#include "image.h"

#define BOUNDARY_FOLLOWING "Boundary Following"
#define CHAIN_CODE "Chain Code"
#define SPLITTING "Splitting"
#define BASIC_DESCRIPTORS "Descritores Básicos"
#define MOMENT_INVARIANTS "Momentos invariantes"
#define HISTOGRAM_DESCRIPTOR "Descritores de Histograma"


class RepresentationDialog : public QDialog{
    Q_OBJECT

    public:
        RepresentationDialog(QWidget *, QImage *);
        ~RepresentationDialog();

        void changeFilter(QString);

    signals:
        void done(QImage *);
        void done();

    public slots:
        void apply();
        void changePage(QListWidgetItem *, QListWidgetItem *);
        void boundaryFollowingRepresentation();
        void chainCodeRepresentation();
        void splittingRepresentation();

    private:
        void createIcons();
        void addButton(QListWidgetItem *, QString, QString);

        void update();
        void revert();

        Filter *filter;
        QImage *originalImage;
        QImage *testImage;

        Image *preview;
        QListWidget *contentsWidget;
        QStackedWidget *pagesWidget;
};

#endif
